<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>
        {wc:$key}
    </title>
    <meta content="app-id=518966501" name="apple-itunes-app"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, maximum-scale=1.0"/>
    <meta content="yes" name="apple-mobile-web-app-capable"/>
    <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
    <meta content="telephone=no" name="format-detection"/>
    <link href="{G_TEMPLATES_CSS}/mobile/comm.css?v=20150129" rel="stylesheet" type="text/css"/>
    <link href="{G_TEMPLATES_CSS}/mobile/goods.css" rel="stylesheet" type="text/css"/>
    <script src="{G_TEMPLATES_JS}/mobile/jquery190.js" language="javascript" type="text/javascript"></script>
    {wc:if $shopitem=='itemfun'}
    <script id="pageJS" data="{G_TEMPLATES_JS}/mobile/goodsInfo.js" language="javascript"
            type="text/javascript"></script>
    {wc:else}
    <script id="pageJS" data="{G_TEMPLATES_JS}/mobile/LotteryDetail.js" language="javascript"
            type="text/javascript"></script>
    {wc:if:end}
</head>
<body>
<div class="h5-1yyg-v1" id="loadingPicBlock">

    <!-- 栏目页面顶部 -->


    <!-- 内页顶部 -->

    {wc:templates "mobile/index","top"}
    <!-- 内页顶部 -->

    <input name="hidGoodsID" type="hidden" id="hidGoodsID"
           value="{wc:if $itemlist}{wc:$itemlist[0]['q_uid']}{wc:if:end}"/>   <!--上期获奖者id-->
    <input name="hidCodeID" type="hidden" id="hidCodeID" value="{wc:$item['id']}"/>     <!--本期奖品id-->
    <section class="goodsCon pCon">
        <!-- 导航 -->
        <div id="divPeriod" class="pNav">
            <div class="loading"><b></b>正在加载</div>
            <ul class="slides">
                {wc:$loopqishu}
            </ul>
        </div>

        {wc:php:start}
        $sysj=$item['xsjx_time']-time();
        {wc:php:end}

        <!-- 揭晓信息 -->
        {wc:if $item['q_end_time']!='' && $item['q_end_time'] <= time()}
        <div class="pProcess pProcess2">
            <div class="pResults">
                <div class="pResultsL" onclick="location.href='{WEB_PATH}/mobile/mobile/userindex/{wc:$item['q_uid']}'">
                    <a>
                        <img src="{wc:fun:get_user_key($item['q_uid'],'img')}">
                        <span>{wc:fun:get_user_name($item['q_uid'])}</span>
                    </a>
                    <s></s>
                </div>
                <div class="pResultsR">
                    <div class="g-snav">
                        <div class="g-snav-lst">总共购买<br>
                            <dd><b class="orange">{wc:$gorecode['gonumber']}</b><br>人次</dd>
                        </div>
                        <div class="g-snav-lst">揭晓时间<br>
                            <dd class="gray9"><span>{wc:fun:str_replace(' ','<br>',microt($item['q_end_time']))}</span>
                            </dd>
                        </div>
                        <div class="g-snav-lst">购买时间<br>
                            <dd class="gray9"><span>{wc:fun:str_replace(' ','<br>',microt($gorecode['time']))}</span>
                            </dd>
                        </div>
                    </div>
                </div>
                <p><a href="{WEB_PATH}/mobile/mobile/calResult/{wc:$item['id']}" class="fr">查看计算结果</a>幸运码：<b
                        class="orange">{wc:$item['q_user_code']}</b></p>
            </div>
        </div>
        {wc:if:end}

        <!-- 揭晓倒计时 -->
        {wc:if ( $item['q_end_time']!='' && $item['q_end_time'] > time() ) }
        <div id="divLotteryTime" class="pProcess clearfix" data-id="{wc:$item['id']}"
             data-endtime="{wc:fun:ceil($item['q_end_time']-time())}">
            <div class="pCountdown">
                <div class="g-snav">
                    <div class="g-snav-lst">揭晓<br>倒计时<s></s></div>
                    <div class="g-snav-lst"><b class="minute">99</b><em>分</em></div>
                    <div class="g-snav-lst"><b class="second">99</b><em>秒</em></div>
                    <div class="g-snav-lst"><b class="millisecond">99</b><em>毫秒</em></div>
                </div>
            </div>
        </div>
        {wc:if:end}

        <!-- 产品图 -->
        <div class="pPic pPicBor">
            <div class="pPic2">
                <div id="sliderBox" class="pImg">
                    <div class="loading"><b></b>正在加载</div>
                    <ul class="slides">
                        {wc:loop $item['picarr'] $imgtu}
                        <li><img src="{G_UPLOAD_PATH}/{wc:$imgtu}" class="animClass"/></li>
                        {wc:loop:end}
                    </ul>
                </div>
            </div>
            {wc:if $item['q_end_time']=='' && $item['xsjx_time']!=0}
            <span id="spAutoFlag" class="z-limit-tips">限时揭晓</span>
            {wc:if:end}
        </div>

        <!-- 条码信息 -->


        <div class="pDetails {wc:if $item['q_end_time']!=''}pDetails-end{wc:if:end}">
            <b>(第{wc:$item['qishu']}期){wc:$item['title']} <span></span></b>
            <p class="price">价值：<em class="arial gray">￥{wc:$item['money']}</em></p>

            {wc:if empty($item['q_end_time'])}
            <div class="Progress-bar">
                <p class="u-progress" title="已完成{wc:fun:percent($item['canyurenshu'],$item['zongrenshu'])}">
						<span class="pgbar" style="width:{wc:$item['canyurenshu']/$item['zongrenshu']*100}%;">
							<span class="pging"></span>
						</span>
                </p>
                <ul class="Pro-bar-li">
                    <li class="P-bar01"><em>{wc:$item['canyurenshu']}</em>已参与</li>
                    <li class="P-bar02"><em>{wc:$item['zongrenshu']}</em>总需人次</li>
                    <li class="P-bar03"><em>{wc:$item['zongrenshu']-$item['canyurenshu']}</em>剩余</li>
                </ul>
            </div>
            {wc:if:end}
            {wc:if $item['q_end_time'] !=''}
            {wc:if $item['q_end_time'] > time() }
            <div class="pClosed">正在揭晓</div>
            {wc:else}
            <div class="pClosed">本期已揭晓</div>
            {wc:if:end}
            {wc:if $itemxq==1}
            <div class="pOngoing" codeid="{wc:$itemzx['id']}">第<em class="arial">{wc:$itemzx['qishu']}</em>期
                正在进行中……<span class="fr">查看详情</span></div>
            {wc:if:end}
            {wc:elseif $item['zongrenshu']==$item['canyurenshu']}
            {wc:if $item['xsjx_time']!=0}
            <div id="divAutoRTime" class="pSurplus" time="{wc:$sysj}"
                 timeAlt="{wc:fun:date('Y-m-d-H',$item['xsjx_time'])}"><p><span>限时揭晓</span>剩余时间：<em>00</em>时<em>00</em>分<em>00</em>秒
            </p></div>
            {wc:if:end}
            <div class="pClosed">下手慢了！！ 被抢光啦！！</div>
            {wc:else}
            {wc:if $item['xsjx_time']!=0}
            <div id="divAutoRTime" class="pSurplus" time="{wc:$sysj}"
                 timeAlt="{wc:fun:date('Y-m-d-H',$item['xsjx_time'])}"><p><span>限时揭晓</span>剩余时间：<em>00</em>时<em>00</em>分<em>00</em>秒
            </p></div>
            {wc:if:end}
            <div id="btnBuyBox" class="" codeid="{wc:$item['id']}">
                <a href="javascript:;" class="orgBtn">立即夺宝</a>
                <!--<a href="javascript:;" class="fr addBtn">加入购物车</a>-->
            </div>
            {wc:if:end}
        </div>
        <!-- 参与记录，奖品详细，晒单导航 -->
        <div class="joinAndGet">
            <dl>
                <a href="{WEB_PATH}/mobile/mobile/goodspost/{wc:$item['sid']}"><b class="fr z-arrow"></b>已有<span
                        class="orange arial">{wc:fun:count($shaidan)}</span>个幸运者晒单<strong
                        class="orange arial">{wc:$sum}</strong>条评论</a>
                <a href="{WEB_PATH}/mobile/mobile/goodsdesc/{wc:$item['id']}"><b class="fr z-arrow"></b>图文详情<em>（建议WIFI下使用）</em>
                </a>
                <a href="{WEB_PATH}/mobile/mobile/buyrecords/{wc:$item['id']}"><b class="fr z-arrow"></b>所有夺宝记录</a>
            </dl>
            <!-- 上期获得者 -->
            {wc:if $item['q_end_time'] !=''}
            {wc:if ( $item['q_end_time']!='' && $item['q_end_time'] > time() ) }
            {wc:else}
            <ul id="prevPeriod" class="m-round" codeid="{wc:$gorecode['shopid']}" uweb="{wc:$gorecode['uid']}">
                <li class="fl"><s></s><img src="{G_TEMPLATES_IMAGE}/mobile/loading.gif"
                                           src2="{wc:fun:get_user_key($itemlist[0]['q_uid'],'img')}"/>
                </li>
                <li class="fr"><b class="z-arrow"></b></li>
                <li class="getInfo">
                    <dd>
                        <em class="blue">{wc:fun:get_user_name($itemlist[0]['q_uid'])}</em>({wc:fun:get_ip($gorecode['id'],'ipcity')})
                    </dd>
                    <dd>总共购买：<em class="orange arial">{wc:$gorecode['gonumber']}</em>人次</dd>
                    <dd>幸运购买码：<em class="orange arial">{wc:$gorecode['huode']}</em></dd>
                    <dd>揭晓时间：{wc:fun:microt($itemlist[0]['q_end_time'])}</dd>
                    <dd>购买时间：{wc:fun:microt($gorecode['time'])}</dd>
                </li>
            </ul>
            {wc:if:end}
            {wc:if:end}

        </div>
    </section>

    {wc:templates "mobile/index","footer"}
    <script language="javascript" type="text/javascript">
        var Path = new Object();
        Path.Skin = "{G_TEMPLATES_STYLE}";
        Path.Webpath = "{WEB_PATH}";

        var Base = {
            head: document.getElementsByTagName("head")[0] || document.documentElement,
            Myload: function (B, A) {
                this.done = false;
                B.onload = B.onreadystatechange = function () {
                    if (!this.done && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
                        this.done = true;
                        A();
                        B.onload = B.onreadystatechange = null;
                        if (this.head && B.parentNode) {
                            this.head.removeChild(B)
                        }
                    }
                }
            },
            getScript: function (A, C) {
                var B = function () {
                };
                if (C != undefined) {
                    B = C
                }
                var D = document.createElement("script");
                D.setAttribute("language", "javascript");
                D.setAttribute("type", "text/javascript");
                D.setAttribute("src", A);
                this.head.appendChild(D);
                this.Myload(D, B)
            },
            getStyle: function (A, B) {
                var B = function () {
                };
                if (callBack != undefined) {
                    B = callBack
                }
                var C = document.createElement("link");
                C.setAttribute("type", "text/css");
                C.setAttribute("rel", "stylesheet");
                C.setAttribute("href", A);
                this.head.appendChild(C);
                this.Myload(C, B)
            }
        }
        function GetVerNum() {
            var D = new Date();
            return D.getFullYear().toString().substring(2, 4) + '.' + (D.getMonth() + 1) + '.' + D.getDate() + '.' + D.getHours() + '.' + (D.getMinutes() < 10 ? '0' : D.getMinutes().toString().substring(0, 1))
        }
        Base.getScript('{G_TEMPLATES_JS}/mobile/Bottom.js');


    </script>
    <script>
        $(function () {
            {
                wc:if $itemlist}
            $(".blue").click(function () {
                window.location.href = "{WEB_PATH}/mobile/mobile/userindex/{wc:$itemlist[0]['q_uid']}";
            });

            $(".orange.arial").click(function () {
                window.location.href = "{WEB_PATH}/mobile/mobile/dataserver/{wc:$itemlist[0]['id']}";
            });
            {
                wc:if:
                end
            }

            // 揭晓倒计时
            var divLotteryTime = $('#divLotteryTime');
            if (divLotteryTime.size() > 0) {
                var id = divLotteryTime.attr('data-id');
                var minute = divLotteryTime.find('b.minute');
                var second = divLotteryTime.find('b.second');
                var millisecond = divLotteryTime.find('b.millisecond');
                var tips = minute.parent().prev();
                var times = (new Date().getTime()) + 1000 * divLotteryTime.attr('data-endtime');
                var timer = setInterval(function () {
                    var time = times - (new Date().getTime());
                    if (time < 1) {
                        clearInterval(timer);
                        tips.css('line-height', '35px').css('color', '#FF5152').html('刷新下，幸运者就是你！');
                        minute.parent().remove();
                        second.parent().remove();
                        millisecond.parent().remove();

                        var checker = function () {
                            $.getJSON(Gobal.Webpath + "/api/getshop/lottery_shop_huode/" + new Date().getTime(), {
                                'test': true,
                                'gid': id
                            }, function (info) {
                                if (info.error) {
                                    tips.html('刷新下，幸运者就是你');
                                    setTimeout(checker, 1000);
                                } else {
                                    tips.html('揭晓成功！');
                                    setTimeout(function () {
                                        location.reload();
                                    }, 200);
                                }
                            });
                        };
                        setTimeout(checker, 750);
                        return;
                    }

                    i = parseInt((time / 1000) / 60);
                    s = parseInt((time / 1000) % 60);
                    ms = String(Math.floor(time % 1000));
                    ms = parseInt(ms.substr(0, 2));
                    if (i < 10)i = '0' + i;
                    if (s < 10)s = '0' + s;
                    if (ms < 10)ms = '0' + ms;
                    minute.html(i);
                    second.html(s);
                    millisecond.html(ms);
                }, 41);

            }

        })

    </script>
</div>
</body>
</html>
